package priv.abadstring.study.rocketmq.javaapi;

import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.client.producer.DefaultMQProducer;

/**
 * 创建主题
 *
 * @author aBadString
 * @date 2021-08-01 14:31:49
 */
public class CreateTopic {
    public static void main(String[] args) throws MQClientException {
        DefaultMQProducer producer = new DefaultMQProducer("haoke");
        producer.setNamesrvAddr("abadstring.me:9876");
        producer.start();

        // 创建主题. broker 名称, topic 名称, 消息队列数量
        producer.createTopic("broker-haoke", "song-song",8);

        producer.shutdown();
    }
}
